import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Properties;

public class No20 {

	public static void main(String[] args) throws FileNotFoundException, IOException {
		Properties properties = new Properties();
		// properties.load(new FileInputStream("file.properties"));

		ClassLoader loader = Thread.currentThread().getContextClassLoader();
		InputStream stream = loader.getResourceAsStream("file/file.properties");
		properties.load(stream);
//		System.out.println(properties.getProperty("maxTarget"));
		Iterator<Entry<Object, Object>> entries = properties.entrySet().iterator();
		Map<String, String> map = new HashMap<String, String>();
		while (entries.hasNext()) {
			Entry<Object, Object> thisEntry = (Entry<Object, Object>) entries.next();
			String key = (String) thisEntry.getKey();
			String value = (String) thisEntry.getValue();
			map.put(key, value);
		}
		
		System.out.println(map);
		
	}
}
